package kg.aibek.projecteuler.p51;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import kg.aibek.poker.Hand;

public class Problem54 {
	public void solve() throws FileNotFoundException {
		Scanner scan = new Scanner(new File("C:\\Users\\aosmonov\\Desktop\\jeke\\poker.txt"));

		int count = 0;
		while (scan.hasNextLine()) {
			String str = scan.nextLine();
			Hand hand1 = new Hand(str.substring(0, 14));
			Hand hand2 = new Hand(str.substring(15));

			if (hand1.compareTo(hand2) >= 0) {
				count++;
			}
		}

		System.out.println(count);
	}

	public static void main(String[] args) {
		Problem54 p = new Problem54();
		try {
			p.solve();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}
}
